#include <iostream>
using namespace std;
int main() {
    string s;
    cin >> s;
    if(s == "") cout << "" << endl;
    int cnto = 0, cntp = 0, cnt = 0;
    int start = 0, end = 0;
    // 定位前缀第一次出现o的位置
    for(int i = 0; i < s.length(); ) {
        if(s[i] == 'p') ++i;
        else {
            if(s[i] == 'o') {
                start = i;
                while(s[i] == 'o') {
                    cnto++;
                    i++;
                }
                break;
            }
        }
    }
    for(int i = s.length()-1; i >= 0; ) {
        if(s[i] == 'o') --i;
        else {
            if(s[i] == 'p') {
                end = i;
                while(s[i] == 'p') {
                    cntp++;
                    i--;
                }
                break;
            }
        }
    }
    cnt = min(cnto, cntp);
    while(cnt--) {
        s[start++] = 'p';
        s[end--] = 'o';
    }
    cout << s << endl;
}